/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: zhongyisheng
 * Date: 2024-07-24
 * Time: 18:43
 */

class Alg<E extends Comparable<E>>{
    public E findMax(E[ ] array) {
        E max = array[0];
        for (int i = 1; i < array.length; i++) {
            if(max.compareTo(array[i])<0){
                max = array[i];
            }
        }
        return max;
    }
}

public class TestGeneric {
    public static void main(String[] args) {
        Integer[] array = {12,53,2,4,66};
        Alg<Integer> alg = new Alg<>();
        int max = alg.findMax(array);
        System.out.println(max);
    }

}
